package com.hsogoo.study.spring.propertysource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by za-huangsaigang on 2018/9/17.
 */
public class CustomizePropertyBean implements InitializingBean {

    @Value("${appName}")
    private String appName;

    public String getAppName() {
        return appName;
    }

    public CustomizePropertyBean() {
        System.out.println("CustomizePropertyTest init...");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println(appName);
    }
}
